﻿namespace Journey.Web.Areas.Users
{
    using System.Web.Mvc;

    /// <summary>
    /// 注册区域信息。
    /// </summary>
    public class UsersAreaRegistration : AreaRegistration
    {
        /// <summary>
        /// 区域名称。
        /// </summary>
        public override string AreaName
        {
            get
            {
                return "Users";
            }
        }

        /// <summary>
        /// 注册区域。
        /// </summary>
        /// <param name="context">区域注册信息上下文。</param>
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "user.register",
                "user/register",
                new { controller = "User", action = "Register" }
            );

            context.MapRoute(
                "user.show",
                "user/show/{accountNumber}",
                new { controller = "User", action = "Show", accountNumber = UrlParameter.Optional }
            );

            context.MapRoute(
                "user.index",
                "user",
                new { controller = "User", action = "Index" }
            );

            //context.MapRoute(
            //    "account.login",
            //    "account/login",
            //    new { controller = "Account", action = "Login" },
            //    new[] { "Journey.Web.Areas.Users.Controllers" }
            //);
            //context.MapRoute(
            //    "account.logOff",
            //    "account/logoff",
            //    new { controller = "Account", action = "LogOff" },
            //    new[] { "Journey.Web.Areas.Users.Controllers" }
            //);
            //context.MapRoute(
            //    "user.default",
            //    "user/{controller}/{action}/{id}",
            //    new { action = "Index", id = UrlParameter.Optional }
            //);IUserAppService
        }
    }
}